﻿using Iworld.Backstage.Framework;
using Iworld.Backstage.Framework.AuthorService;
using Iworld.Toolkit.Helper;
using Iworld.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Iworld.Backstage
{
    [View(Page.充值卡记录)]
    public partial class RechargeCardRecordsPage : UserControl
    {
        public RechargeCardRecordsPage()
        {
            InitializeComponent();
        }

        private void Copy(object sender, RoutedEventArgs e)
        {
            RechargeCardRecordExport rcr = XamlHelper.GetDataContext<RechargeCardRecordExport>(sender);
            if (rcr.Account != null && rcr.Password != null)
            {
                try
                {
                    Clipboard.SetText("卡号:" + rcr.Account + " 密码:" + rcr.Password);
                    new ErrorPrompt() { Info = "已成功复制到剪贴板" }.Show();
                }
                catch (Exception)
                {
                    new ErrorPrompt() { Info = "复制失败" }.Show();
                   
                }
    
            }
        }
    }
}
